import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
const store = new Vuex.Store({
	state: {
		navIndex: 0
	},
	mutations: {
		//登录
		changeNavIndex(state, provider) {
			state.navIndex = provider;
			uni.setStorage({ //缓存用户登陆状态
				key: 'navIndex',
				data: provider
			})
		},

	}
})

export default store
